// HEAD YieldCurve_InterpolatedBondYTMCurve H
/*==================================================================================================================
                  Copyright (C) 2013 SUMSCOPE L.P.
                  ALL RIGHTS RESERVED 
====================================================================================================================
File description:
    This class is used to build YTM Curve using different interpolated methods.

====================================================================================================================
...Date      Name                                  Description of Change
15-Apr-2013  James Xu                              Initial version
25-Apr-2013  James Xu                              Add ResampleFixedPoints
07-May-2013  James Xu                              Add overloaded method GetYieldCurvePoints
13-May-2013  James Xu                              Restructure this class
14-May-2013  James Xu                              Add overloaded constructor for LocalLinearHermite Curve
$HISTORY$
===================================================================================================================*/

#ifndef YC_INTERPOATED_BOND_YTM_CURVE_H
#define YC_INTERPOATED_BOND_YTM_CURVE_H

#include <vector>

#include "BondYTMCurve.h"
#include "NonLinearInterpolatedMethods.h"
#include "utility.h"

namespace YieldCurve
{
    // ----------------------------------------------------------------------------------------
    // -------------- InterpolatedBondYTMCurve class- ----------------------------------------
    // ----------------------------------------------------------------------------------------
    class InterpolatedBondYTMCurve : public BondYieldCurve
    {
    public:
        // For Hermite curve
        InterpolatedBondYTMCurve(const std::vector<YieldPoints>& curveKnots);
        
        // For LocalLinear + Hermite Curve
        InterpolatedBondYTMCurve(const std::vector<YieldPoints>& curveKnots, const std::vector<double>& keyMaturities);


        virtual ~InterpolatedBondYTMCurve(void);

    public:
        // Return the YTM of a given maturity on the yield curve.
        virtual double GetYield(double t);

        // Return a vector of interpolated points on the yield curve 
        virtual int GetYieldCurvePoints(std::vector<double>& samplingMaturities, std::vector<YieldPoints>& curvePoints);

        // Return a vector of interpolated points on the yield 
        virtual int GetYieldCurvePoints(int count, std::vector<YieldPoints>& curvePoints);

    private:
        // Specific method used to build the curve
        InterpolatedMethod* interpolatedMethod_;
    };
}

#endif
